﻿namespace Pub.Class
{
    using System;
    using System.Threading;

    public class WriterLockSlimDisposable : IDisposable
    {
        private readonly ReaderWriterLockSlim _rwLock;

        public WriterLockSlimDisposable(ReaderWriterLockSlim rwLock)
        {
            this._rwLock = rwLock;
            this._rwLock.EnterWriteLock();
        }

        void IDisposable.Dispose()
        {
            this._rwLock.ExitWriteLock();
        }
    }
}

